package com.dao.green.cn.applibary.base;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

/**
 * Created by Ant on 2017/7/27  19:52
 * <p>
 * <p>
 *
 * @version 1.0.0
 * @auther Ant
 */

public abstract class BaseActivity extends AppCompatActivity implements BaseInterface {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        createBinding();
        initView();
        initData();
        initListener();
    }


    public abstract void createBinding();


    /**
     * goto target activity
     * @param target
     */
    public void goTo(Class<? extends Activity> target) {
        if (target == null) {
            return;
        }
        BaseActivity.this.startActivity(new Intent(BaseActivity.this, target));
    }

}
